﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="NuGetTemplatesPlus"
    targetNamespace="urn:NuGetTemplatesPlus.1"
    elementFormDefault="qualified"
    xmlns="urn:NuGetTemplatesPlus.1"
    xmlns:mstns="http://tempuri.org/NuGetTemplatesPlus.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>

  

  <xs:complexType name="RuleBody" abstract="true">

    <xs:sequence minOccurs="0" maxOccurs="unbounded">
      <xs:choice>
        <xs:element name="includeXmlSchema">
          <xs:complexType>
            <xs:attribute name="file" type="xs:string" use="required" />
          </xs:complexType>
        </xs:element>
        <xs:element name="applyCustomTool">
          <xs:complexType>            
            <xs:attribute name="type" type="xs:string" use="required" />
            <xs:attribute name="parameter" type="xs:string" use="optional" />
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:sequence>
    
  </xs:complexType>

  <xs:element name="nuGetTemplatesPlus">
    <xs:complexType>
      <xs:sequence minOccurs="0" maxOccurs="1">

        <xs:element name="dependencies" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="dependency" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:attribute name="id" type="xs:string" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        
        <xs:element name="sourceFiles">
          <xs:complexType>
            <xs:sequence minOccurs="0" maxOccurs="unbounded">
              <xs:choice>
                
                <xs:element name="ifFileExtension">
                  <xs:complexType>
                    <xs:complexContent>
                      <xs:extension base="RuleBody">
                        <xs:attribute name="extension" type="xs:string" />
                      </xs:extension>
                    </xs:complexContent>                    
                  </xs:complexType>
                </xs:element>

                <xs:element name="ifCustomCondition">
                  <xs:complexType>
                    <xs:complexContent>
                      <xs:extension base="RuleBody">
                        <xs:attribute name="type" type="xs:string" />
                        <xs:attribute name="parameter" type="xs:string" use="optional" />
                      </xs:extension>
                    </xs:complexContent>
                  </xs:complexType>
                </xs:element>
                
              </xs:choice>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>